home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 46 / Amiga Format CD46 (1999-10-20)(Future Publishing)(GB)[!][issue 1999-12].iso / -serious- / graphics / thumbnailmaker / thumbnailmaker.rexx < prev   
Encoding:
OS/2 REXX Batch file  |  1999-09-06  |  27.8 KB  |  857 lines

  1. /* $VER: ThumbNailMaker.rexx 1.9 (1999-08-22) */
  2. OPTIONS RESULTS
  3. libs = "rexxarplib.library rexxdossupport.library rexxkuang11.library rexxsupport.library"
  4. DO UNTIL libs='';PARSE VAR libs lib libs
  5. IF EXISTS('libs:'lib)|EXISTS('Libs/'lib)|EXISTS(lib) THEN DO
  6. IF ~show('L',lib) THEN call addlib(lib,0,-30,0);END;ELSE DO
  7. Say 'Library Error. Unable to open 'lib
  8. address ThumbNailMaker ;quit
  9. END;END
  10. call Tags
  11. SELECT
  12. WHEN arg(1)="ABOUT" then call about
  13. WHEN arg(1)="SAVE" then call Config("S")
  14. WHEN arg(1)="START" then call start
  15. WHEN arg(1)="GOURL" then call GoToURL
  16. OTHERWISE call init
  17. end
  18. exit
  19. init:
  20. address ThumbNailMaker
  21. window ID THNAM TITLE '"ThumbNailMaker v1.9"' COMMAND '"quit"' PORT ThumbNailMaker ATTRS MUIA_Window_ScreenTitle '"ThumbNailMaker 1.9 ©1998-1999 Lorens Johansson Freely Distributable Emailware"'
  22. menu LABEL "ThumbNailMaker"
  23. item COMMAND '"method 'MUIM_Application_AboutMUI' 0"' PORT ThumbNailMaker  ATTRS MUIA_Menuitem_Shortcut 'M' LABEL "About MUI"
  24. item COMMAND '"ThumbNailMaker.rexx ABOUT"' ATTRS MUIA_Menuitem_Shortcut 'A' LABEL "About"
  25. item ATTRS MUIA_Menuitem_Title '-1'
  26. item COMMAND '"quit"' PORT ThumbNailMaker ATTRS MUIA_Menuitem_Shortcut 'Q' LABEL "Quit"
  27. endmenu
  28. menu LABEL "Settings"
  29. item COMMAND '"ThumbNailMaker.rexx SAVE"' ATTRS MUIA_Menuitem_Shortcut 'S' LABEL "Save Settings..."
  30. item ATTRS MUIA_Menuitem_Title '-1'
  31. item COMMAND '"method 'MUIM_Application_OpenConfigWindow'"' PORT ThumbNailMaker LABEL "MUI Prefs..."
  32. endmenu
  33. text help '"ThumbNailMaker v1.9 by\nLorens Johansson (http://members.xoom.com/snorslex)\nIf you use this program, you are required to\nEmail the author (SnorsleX@Home.se). Otherwise,\nhow is he supposed to know to keep supporting\nThumbNailMaker ?!?\n\033rLorens Johansson"' label "\033c\033bThumbNailMaker v1.9\033n\n\033cLorens Johansson\n\033cFreely Distributable Emailware"
  34. text ID KEY ATTRS MUIA_Text_Contents '"\033c\033bUnregistered! Pease register! It is free!"'
  35. group REGISTER ATTRS MUIA_CycleChain 1 LABELS "Main Settings,HTML Settings,HTML Pic Settings,HTML Colours"
  36. group
  37. group frame label "GFXCon Settings"
  38. group ATTRS MUIA_Group_Columns 2
  39. label "_GFXCon path:"
  40. popasl ID CPATH ATTRS MUIA_CycleChain 1 MUIA_ControlChar c2d("g") ASLFR_RejectIcons 1 ASLFR_TitleText '"Choose the GFXCon executable!"' help '"The path to GFXCon, including the executable file!"'
  41. label "ThumbNail size:"
  42. group HORIZ
  43. label "_X:"
  44. string ID CSIZX ATTRS MUIA_CycleChain 1 MUIA_ControlChar c2d("x") help '"The horizontal size of the ThumbNails!"'
  45. label "_Y:"
  46. string ID CSIZY ATTRS MUIA_CycleChain 1 MUIA_ControlChar c2d("y") help '"The vertical size of the ThumbNails!"'
  47. endgroup
  48. label "_JPEG Quality:"
  49. group HORIZ
  50. slider ID CJPGQ ATTRS MUIA_CycleChain 1 MUIA_ControlChar c2d("j") MUIA_Slider_Min 1 MUIA_Slider_Max 100 help '"The quality of the thumbnails. (Only affects JPEG pictures!)"'
  51. label "_ThumbNail format:"
  52. string ID CPICF ATTRS MUIA_CycleChain 1 MUIA_ControlChar c2d("t") help '"Which format the ThumbNails should be! For example gif or jpg."'
  53. endgroup
  54. endgroup
  55. endgroup
  56. group frame label "General Settings"
  57. group ATTRS MUIA_Group_Columns 2
  58. label "_Filepattern:"
  59. string ID GPATT ATTRS MUIA_CycleChain 1 MUIA_ControlChar c2d("f") help '"Which files the program should ignore! This is a normal requester pattern."'
  60. label "S_ource directory:"
  61. popasl ID GDIR ATTRS MUIA_CycleChain 1 MUIA_ControlChar c2d("o") ASLFR_DrawersOnly 1 ASLFR_TitleText '"Choose where the pics are!"' help '"The directory where the pictures are!"'
  62. endgroup
  63. group ATTRS MUIA_Group_Columns 4
  64. label "ThumbNail dest _dir:"
  65. string ID GTDR ATTRS MUIA_CycleChain 1 MUIA_ControlChar c2d("d") help '"The name of the subdirectory where the ThumbNails should be stored,\n ONLY a name no path or slash."'
  66. label "Q_uiet:"
  67. check ID QUIET ATTRS MUIA_CycleChain 1 MUIA_ControlChar c2d("u") help '"Puts >NIL: in the commandline! ie, GFXCon will not show the errors in a separate window!"'
  68. endgroup
  69. endgroup
  70. endgroup
  71. group
  72. group ATTRS MUIA_Group_Columns 2
  73. label "HT_ML names:"
  74. string ID HINNA ATTRS MUIA_CycleChain 1 MUIA_ControlChar c2d("m") help '"Select the name of the html files (before the number and extension: *****1.html)"'
  75. endgroup
  76. group ATTRS MUIA_Group_Columns 6
  77. label "_Pics per page:"
  78. string ID HPPP ATTRS MUIA_CycleChain 1 MUIA_ControlChar c2d("p") help '"How many ThumbNails each index page should have."'
  79. label "_X Resolution:"
  80. string ID HXRES ATTRS MUIA_CycleChain 1 MUIA_ControlChar c2d("x") help '"Which horizontal resolution the page should be optimized for!"'
  81. label "_Table border:"
  82. string ID HBORD ATTRS MUIA_CycleChain 1 MUIA_ControlChar c2d("t") help '"How thick the border of the frames should be!"'
  83. endgroup
  84. group ATTRS MUIA_Group_Columns 3
  85. label "_Header:"
  86. string ID HHEAD ATTRS MUIA_CycleChain 1 MUIA_ControlChar c2d("h") help '"What text it would be in the header of the index HTML files! You can use HTML tags too."'
  87. group FRAME POP ATTRS MUIA_CycleChain 1
  88. label "\033l%d = Date\n%p = Path\n%r = Directory\n%t = Time"
  89. endgroup
  90. label "_Footer:"
  91. string ID HFOOT ATTRS MUIA_CycleChain 1 MUIA_ControlChar c2d("f") help '"What text it would be in the footer of the index HTML files! You can use HTML tags too."'
  92. group FRAME POP ATTRS MUIA_CycleChain 1
  93. label "\033l%d = Date\n%p = Path\n%r = Directory\n%t = Time"
  94. endgroup
  95. endgroup
  96. group frame ATTRS MUIA_Group_Columns 3 label "Indexlinks"
  97. label "_Where:"
  98. cycle ID HINLI ATTRS MUIA_CycleChain 1 MUIA_ControlChar c2d("w") help '"Choose where to put the links to the other indexpages!"' LABELS "Both,Only Top,Only Bottom"
  99. slider ID HIFSI ATTRS MUIA_CycleChain 1 MUIA_Numeric_Format '"Fontsize: %ld"' MUIA_Slider_Min 1 MUIA_Slider_Max 7 help '"Choose the size of the Indexlinks!"'
  100. endgroup
  101. group frame label "Stuff under ThumbNails"
  102. slider ID HFSIZ ATTRS MUIA_CycleChain 1 MUIA_Numeric_Format '"Fontsize: %ld"' MUIA_Slider_Min 1 MUIA_Slider_Max 7 help '"Choose the size of the text under the pictures!"'
  103. group ATTRS MUIA_Group_Columns 3
  104. label "Add _LineFeed:"
  105. check ID HLIFE ATTRS MUIA_CycleChain 1 MUIA_ControlChar c2d("l") help '"Choose if you want a linefeed between the picture and the filename/size!"'
  106. group HORIZ
  107. label "Add File_name:"
  108. check ID HFNAM ATTRS MUIA_CycleChain 1 MUIA_ControlChar c2d("n") help '"Put the filename under the picture."'
  109. space HORIZ
  110. endgroup
  111. label "Add Fil_esize:"
  112. check ID HSIZE ATTRS MUIA_CycleChain 1 MUIA_ControlChar c2d("e") help '"Put the size under the picture."'
  113. group HORIZ
  114. label "_In:"
  115. cycle ID HSIKB ATTRS MUIA_CycleChain 1 MUIA_ControlChar c2d("i") help '"Choose between Bytes or KiloBytes."' LABELS "Bytes,KiloBytes"
  116. endgroup
  117. endgroup
  118. endgroup
  119. endgroup
  120. group
  121. group HORIZ
  122. space HORIZ
  123. label "_Make HTML pages for pictures:"
  124. check ID HMHPP ATTRS MUIA_CycleChain 1 MUIA_ControlChar c2d("m") help '"Check this if the pictures should have an HTML page!"'
  125. space HORIZ
  126. endgroup
  127. group ATTRS MUIA_Group_Columns 3
  128. label "_Header:"
  129. string ID HPHEA ATTRS MUIA_CycleChain 1 MUIA_ControlChar c2d("h") help '"What text it would be in the header of the picture HTML files! You can use HTML tags too."'
  130. group FRAME POP ATTRS MUIA_CycleChain 1
  131. label "\033l%c = Filecomment\n%d = Datestamp\n%n = Filename\n%p = Path\n%r = Directory\n%s = Filesize\n%t = Timestamp"
  132. endgroup
  133. label "_Footer:"
  134. string ID HPFOO ATTRS MUIA_CycleChain 1 MUIA_ControlChar c2d("f") help '"What text it would be in the footer of the picture HTML files! You can use HTML tags too."'
  135. group FRAME POP ATTRS MUIA_CycleChain 1
  136. label "\033l%c = Filecomment\n%d = Datestamp\n%n = Filename\n%p = Path\n%r = Directory\n%s = Filesize\n%t = Timestamp"
  137. endgroup
  138. endgroup
  139. endgroup
  140. group
  141. group frame HORIZ label "Background"
  142. cycle ID BACKG ATTRS MUIA_CycleChain 1 MUIA_Weight 1 help '"Select if you want to use a background picture, or just a colour!"' LABELS "BG Colour,BG Picture"
  143. group ATTRS MUIA_Group_Columns 2
  144. label "BG _Colour:"
  145. string ID HBGCO ATTRS MUIA_CycleChain 1 MUIA_ControlChar c2d("c") help '"Which color the HTML files BGs should be! (Like #0000FF)"'
  146. label "BG _Picture:"
  147. popasl ID HBGPI ATTRS MUIA_CycleChain 1 MUIA_ControlChar c2d("p") help '"Which image to use as background!"'
  148. endgroup
  149. endgroup
  150. group frame ATTRS MUIA_Group_Columns 2 label "Colours"
  151. label "_Text Colour:"
  152. string ID CTEXT ATTRS MUIA_CycleChain 1 MUIA_ControlChar c2d("t") help '"Which color the Texts should have! (Like #0000FF)"'
  153. label "_Link Colour:"
  154. string ID CLINK ATTRS MUIA_CycleChain 1 MUIA_ControlChar c2d("l") help '"Which color the Links should have! (Like #0000FF)"'
  155. label "AL_ink Colour:"
  156. string ID CALIN ATTRS MUIA_CycleChain 1 MUIA_ControlChar c2d("i") help '"Which color the ALinks should have! (Like #0000FF)"'
  157. label "_VLink Colour:"
  158. string ID CVLIN ATTRS MUIA_CycleChain 1 MUIA_ControlChar c2d("v") help '"Which color the Visited Links should have! (Like #0000FF)"'
  159. endgroup
  160. endgroup
  161. endgroup
  162. group ATTRS MUIA_Group_Columns 4
  163. button ID START ATTRS MUIA_CycleChain 1 MUIA_ControlChar c2d("s") MUIA_Text_HiChar c2d("s") help '"Starts making thumbnails and HTML pages if chosen!"' COMMAND """ThumbNailMaker.rexx START""" label "Start"
  164. button ATTRS MUIA_CycleChain 1 MUIA_ControlChar c2d("b") MUIA_Text_HiChar c2d("b") help '"Go to the first indexpage!"' COMMAND """ThumbNailMaker.rexx GOURL""" label "Browser"
  165. button ID ABT ATTRS MUIA_CycleChain 1 MUIA_ControlChar c2d("a") MUIA_Text_HiChar c2d("a") help '"Shows some info about ThumbNailMaker."' COMMAND """ThumbNailMaker.rexx ABOUT""" label "About"
  166. button ID QUIT ATTRS MUIA_CycleChain 1 MUIA_ControlChar c2d("q") MUIA_Text_HiChar c2d("q") help '"Quits ThumbNailMaker."' COMMAND '"quit"' PORT ThumbNailMaker label "Quit"
  167. endgroup
  168. endwindow
  169. call Config("L")
  170. call KeyCheck
  171. res=result
  172. if res="No" then do
  173. Address ThumbNailMaker
  174. window ID REGIS TITLE '"Please Register"'
  175. text label "\033c\033bRIGISTER IS FREE!!!\n\n\033nTo register send a mail to:\nSnorsleX@Home.se!\n\n\033c\033bThe reason:\033n\nI want to know how many there\nis that uses ThumbNailMaker."
  176. group ATTRS MUIA_Group_Columns 3
  177. space HORIZ
  178. button ID CLKEY ATTRS MUIA_CycleChain 1 COMMAND '"window ID REGIS close"' PORT ThumbNailMaker label "I will"
  179. space HORIZ
  180. endgroup
  181. endwindow
  182. end
  183. if res="Yes" then do
  184. Address ThumbNailMaker
  185. txt = '"\033cRegistered to: '||name||' (#'||serial||')! Thanks!"'
  186. text ID KEY ATTRS MUIA_Text_Contents txt
  187. end
  188. return
  189. Tags:
  190. ASLFR_DrawersOnly=0x8008002F
  191. ASLFR_RejectIcons=0x8008003C
  192. ASLFR_TitleText=0x80080001
  193. MUIA_Application_Sleep=0x80425711
  194. MUIA_AppMessage=0x80421955
  195. MUIA_ControlChar=0x8042120b
  196. MUIA_Cycle_Active=0x80421788
  197. MUIA_CycleChain=0x80421ce7
  198. MUIA_Disabled=0x80423661
  199. MUIA_Frame=0x8042ac64
  200. MUIA_Gauge_Current=0x8042f0dd
  201. MUIA_Gauge_Horiz=0x804232dd
  202. MUIA_Gauge_InfoText=0x8042bf15
  203. MUIA_Gauge_Max=0x8042bcdb
  204. MUIA_Group_Columns=0x8042f416
  205. MUIA_Group_Rows=0x8042b68f
  206. MUIA_List_Active=0x8042391c
  207. MUIA_List_Entries=0x80421654
  208. MUIA_Menuitem_Shortcut=0x80422030
  209. MUIA_Menuitem_Title=0x804218be
  210. MUIA_Numeric_Format=0x804263e9
  211. MUIA_Selected=0x8042654b
  212. MUIA_ShowMe=0x80429ba8
  213. MUIA_Slider_Level=0x8042ae3a
  214. MUIA_Slider_Max=0x8042d78a
  215. MUIA_Slider_Min=0x8042e404
  216. MUIA_Text_Contents=0x8042f8dc
  217. MUIA_Text_HiChar=0x804218ff
  218. MUIA_Weight=0x80421d1f
  219. MUIA_Window_ScreenTitle=0x804234b0
  220. MUIM_Application_AboutMUI=0x8042d21d
  221. MUIM_Application_OpenConfigWindow=0x804299ba
  222. MUIV_List_Insert_Bottom=-3
  223. R='0A'X
  224. Return
  225. Config:
  226. lors=arg(1)
  227. if OPEN("file","ThumbNailMaker.prefs","R") then do
  228. i=1
  229. do UNTIL EOF("file")
  230. line.i=READLN("file")
  231. i=i+1
  232. end
  233. line.0=i-1
  234. call CLOSE("file")
  235. end
  236. else do
  237. line.0=32
  238. line.1="CPATH    RAM:"
  239. line.2="CSIZX    100"
  240. line.3="CSIZY    100"
  241. line.4="CJPGQ    85"
  242. line.5="CPICF    gif"
  243. line.6="GPATT    ~#?.(htm#?|info|rexx|guide|text)"
  244. line.7="GDIR    RAM:"
  245. line.8="GTDR    thumb"
  246. line.9="QUIET    1"
  247. line.10="HINNA    index"
  248. line.11="HPPP    25"
  249. line.12="HXRES    640"
  250. line.13="HBORD    1"
  251. line.14="HHEAD    <CENTER><H1>%r</H1></CENTER>"
  252. line.15="HFOOT    <CENTER><H1>%r</H1></CENTER>"
  253. line.16="HINLI    Both"
  254. line.17="HIFSI    5"
  255. line.18="HFSIZ    2"
  256. line.19="HLIFE    0"
  257. line.20="HFNAM    1"
  258. line.21="HSIZE    1"
  259. line.22="HSIKB    Bytes"
  260. line.23="HMHPP    1"
  261. line.24="HPHEA    <CENTER><H1>%r</H1></CENTER>"
  262. line.25="HPFOO    <CENTER><H1>%r</H1></CENTER>"
  263. line.26="BACKG    BG Colour"
  264. line.27="HBGCO    #987654"
  265. line.28="HBGPI    RAM:"
  266. line.29="CTEXT    #FFFFFF"
  267. line.30="CLINK    #FF0000"
  268. line.31="CALIN    #FFFFFF"
  269. line.32="CVLIN    #AA0000"
  270. end
  271. call ch("CPATH",lors,"P")
  272. call ch("CSIZX",lors,"T")
  273. call ch("CSIZY",lors,"T")
  274. call ch("CJPGQ",lors,"S")
  275. call ch("CPICF",lors,"T")
  276. call ch("GPATT",lors,"T")
  277. call ch("GDIR",lors,"P")
  278. call ch("GTDR",lors,"T")
  279. call ch("QUIET",lors,"K")
  280. call ch("HINNA",lors,"T")
  281. call ch("HPPP",lors,"T")
  282. call ch("HXRES",lors,"T")
  283. call ch("HBORD",lors,"T")
  284. call ch("HHEAD",lors,"T")
  285. call ch("HFOOT",lors,"T")
  286. call ch("HINLI",lors,"C")
  287. call ch("HIFSI",lors,"S")
  288. call ch("HFSIZ",lors,"S")
  289. call ch("HLIFE",lors,"K")
  290. call ch("HFNAM",lors,"K")
  291. call ch("HSIZE",lors,"K")
  292. call ch("HSIKB",lors,"C")
  293. call ch("HMHPP",lors,"K")
  294. call ch("HPHEA",lors,"T")
  295. call ch("HPFOO",lors,"T")
  296. call ch("BACKG",lors,"C")
  297. call ch("HBGCO",lors,"T")
  298. call ch("HBGPI",lors,"P")
  299. call ch("CTEXT",lors,"T")
  300. call ch("CLINK",lors,"T")
  301. call ch("CALIN",lors,"T")
  302. call ch("CVLIN",lors,"T")
  303. call OPEN("file","ThumbNailMaker.prefs","W")
  304. i=1
  305. do UNTIL i=line.0
  306. call WRITELN("file",line.i)
  307. i=i+1
  308. end
  309. call CLOSE("file")
  310. return
  311. ch:
  312. stringid=arg(1)
  313. saveorload=arg(2)
  314. type=arg(3)
  315. i=1
  316. do until i=line.0
  317. if LEFT(line.i,LENGTH(stringid))=stringid then do
  318. parse var line.i RUBBISH"    "setting
  319. if saveorload="L" then do
  320. select
  321. WHEN type="P" then Address ThumbNailMaker popasl ID stringid content Setting
  322. WHEN type="S" then Address ThumbNailMaker slider ID stringid ATTRS MUIA_Slider_Level setting
  323. WHEN type="C" then Address ThumbNailMaker cycle ID stringid label setting
  324. WHEN type="K" then Address ThumbNailMaker check ID stringid ATTRS MUIA_Selected setting
  325. OTHERWISE Address ThumbNailMaker string ID stringid content Setting
  326. end
  327. end
  328. if saveorload="S" then do
  329. select
  330. WHEN type="P" then Address ThumbNailMaker popasl ID stringid
  331. WHEN type="S" then Address ThumbNailMaker slider ID stringid
  332. WHEN type="C" then Address ThumbNailMaker cycle ID stringid
  333. WHEN type="K" then Address ThumbNailMaker check ID stringid
  334. OTHERWISE Address ThumbNailMaker string ID stringid
  335. end
  336. changeto=result
  337. line.i=stringid"    "changeto
  338. end
  339. end
  340. i=i+1
  341. end
  342. return
  343. about:
  344. address ThumbNailMaker
  345. window ID ABOUT Title '"About ThumbNailMaker v1.9"' COMMAND '"window ID ABOUT close"' PORT ThumbNailMaker
  346. text label "\033c\033bThumbNailMaker v1.9\033n\n\033cFreely Distributable Emailware\n\n\033cPlease visit my homepage:\nhttp://snorslex.amiga.tm/\n\nPlease E-Mail me if you like/hate the program!\nSnorsleX@Home.se\n\n\033r©Copyright 1998-1999 Lorens Johansson"
  347. group HORIZ
  348. space HORIZ
  349. button ID CAB COMMAND '"window ID ABOUT close"' PORT ThumbNailMaker ATTRS MUIA_CycleChain 1 label "Okey"
  350. space HORIZ
  351. endgroup
  352. endwindow
  353. return
  354. start:
  355. address ThumbNailMaker
  356. button ID START ATTRS MUIA_Disabled 1
  357. button ID QUIT ATTRS MUIA_Disabled 1
  358. window ID STAT close
  359. window ID STAT
  360. list ID STALI TITLE '"\033bStatus:"'
  361. gauge ID STAPR ATTRS MUIA_Gauge_Horiz 1 MUIA_Gauge_InfoText '"Processed images (%ld/0)"'
  362. object CLASS '"Scale.mui"'
  363. group ID STAPG
  364. gauge ID STAPI ATTRS MUIA_Gauge_Horiz 1 MUIA_Gauge_InfoText '"Picture HTML files (%ld/0)"'
  365. object CLASS '"Scale.mui"'
  366. endgroup
  367. gauge ID STAIN ATTRS MUIA_Gauge_Horiz 1 MUIA_Gauge_InfoText '"Index HTML files (%ld/0)"'
  368. object CLASS '"Scale.mui"'
  369. group ID PRTAB HORIZ
  370. space HORIZ
  371. label "Press to abort, and wait:"
  372. check ID STABO
  373. space HORIZ
  374. endgroup
  375. group HORIZ ID STGRP ATTRS MUIA_ShowMe 0
  376. text ID TIMER
  377. button ID STCLO ATTRS MUIA_CycleChain 1 COMMAND '"window ID STAT close"' PORT ThumbNailMaker label "Close"
  378. endgroup
  379. endwindow
  380. popasl ID CPATH
  381. GFXCON=result
  382. string ID CSIZX
  383. sizex=result
  384. string ID CSIZY
  385. sizey=result
  386. slider ID CJPGQ
  387. QUALITY=result
  388. string ID CPICF
  389. FORMAT=result
  390. string ID GPATT
  391. PATTERN=result
  392. popasl ID GDIR
  393. directory=result
  394. string ID GTDR
  395. dest=result
  396. check ID QUIET
  397. QUIET=result
  398. string ID HINNA
  399. indexnames=result
  400. string ID HPPP
  401. perpage=result
  402. string ID HXRES
  403. res=result
  404. string ID HBORD
  405. BORDER=result
  406. string ID HHEAD
  407. HEADER=result
  408. string ID HFOOT
  409. FOOTER=result
  410. cycle ID HINLI
  411. INDEXLINKS=result
  412. slider ID HIFSI
  413. INDEXLINKSSIZE=result
  414. slider ID HFSIZ
  415. FONTSIZE=result
  416. check ID HLIFE
  417. LINEFEED=result
  418. check ID HFNAM
  419. FNAMEUPIC=result
  420. check ID HSIZE
  421. SIZEUPIC=result
  422. cycle ID HSIKB
  423. SIZEKB=result
  424. check ID HMHPP
  425. picpage=result
  426. string ID HPHEA
  427. PHEADER=result
  428. string ID HPFOO
  429. PFOOTER=result
  430. cycle ID BACKG
  431. BGWHICH=result
  432. string ID HBGCO
  433. BGCOLOR=result
  434. popasl ID HBGPI
  435. BGPIC=result
  436. string ID CTEXT
  437. COL1=result
  438. string ID CLINK
  439. COL2=result
  440. string ID CALIN
  441. COL3=result
  442. string ID CVLIN
  443. COL4=result
  444. HEADER=GetPercent(HEADER,"1")
  445. FOOTER=GetPercent(FOOTER,"1")
  446. TEXTCOLOURS=' TEXT="'COL1'" LINK="'COL2'" ALINK="'COL3'" VLINK="'COL4'"'
  447. EIP=0
  448. if ~EXISTS(GFXCON) then do
  449. EIP=1
  450. EIPM="The path to GFXCon doesn't exist!"
  451. end
  452. if ~EXISTS(BGPIC) then do
  453. EIP=1
  454. EIPM="The path to the BG Picture doesn't exist!"
  455. end
  456. if datatype(sizex,W)=0 then do
  457. EIP=1
  458. EIPM="Something is wrong with ThumbNail size X"
  459. end
  460. if datatype(sizey,W)=0 then do
  461. EIP=1
  462. EIPM="Something is wrong with ThumbNail size Y"
  463. end
  464. if datatype(QUALITY,W)=0 then do
  465. EIP=1
  466. EIPM="Something is wrong with JPEG Quality"
  467. end
  468. if datatype(perpage,W)=0 then do
  469. EIP=1
  470. EIPM="Something is wrong with Pics per page"
  471. end
  472. if datatype(res,W)=0 then do
  473. EIP=1
  474. EIPM="Something is wrong with X Resolution"
  475. end
  476. if datatype(BORDER,W)=0 then do
  477. EIP=1
  478. EIPM="Something is wrong with Table Border"
  479. end
  480. if EIP=1 then do
  481. call AddList("\033b"EIPM)
  482. button ID START ATTRS MUIA_Disabled 0
  483. button ID QUIT ATTRS MUIA_Disabled 0
  484. group ID STGRP ATTRS MUIA_ShowMe 1
  485. exit
  486. end
  487. call AddList("Safety-check passed!")
  488. if picpage=0 then group ID STAPG ATTRS MUIA_ShowMe 0
  489. if RIGHT(directory,1)~=":" then
  490. if RIGHT(directory,1)~="/" then directory=directory||"/"
  491. timer_start=time('e')
  492. form="."||format
  493. form=compress(form,"e")
  494. files=filelist(directory||PATTERN,filenames,F,)
  495. if files=0 then do
  496. call AddList("\033bNo files to process!")
  497. button ID START ATTRS MUIA_Disabled 0
  498. button ID QUIT ATTRS MUIA_Disabled 0
  499. group ID STGRP ATTRS MUIA_ShowMe 1
  500. exit
  501. end
  502. gauge ID STAPR ATTRS MUIA_Gauge_Max files MUIA_Gauge_InfoText '"Processed images (%ld/'files')"'
  503. if ~exists(directory||dest) then call makedir(directory||dest)
  504. if RIGHT(dest,1)~=":" then
  505. if RIGHT(dest,1)~="/" then dest=dest||"/"
  506. BACKGROUND=""
  507. if BGWHICH="BG Colour" then BACKGROUND='BGCOLOR="'BGCOLOR'"'
  508. if BGWHICH="BG Picture" then do
  509. BACKGROUND=BGPIC
  510. ADDRESS COMMAND "copy "BACKGROUND" "directory||dest" QUIET"
  511. BACKGROUND=GetFilename(BACKGROUND)
  512. BACKGROUND='BACKGROUND="'dest||BACKGROUND'"'
  513. end
  514. call sort
  515. call AddList("Checking for new pictures...")
  516. do f=1 to files
  517. name=filenames.f
  518. name2=GetFilename(name)
  519. call pragma("STACK",22000)
  520. file=name2
  521. do forever
  522. plats=pos('.',file)
  523. if plats>0 then do
  524. filedots=file
  525. file=DELSTR(file,plats,1)
  526. end
  527. if plats=0 then leave
  528. end
  529. parse var filedots file2 "." .
  530. names.f=file2||"_t"||FORM
  531. if ~exists(directory||dest||names.f) then do
  532. comm=GFXCON||' "'||name'"'
  533. if QUIET=1 then do
  534. comm=comm||' >NIL:'
  535. end
  536. call AddList("Processing file "name2)
  537. comm=comm||' TO "'||directory||dest||names.f||'" FORMAT 'FORMAT
  538. if UPPER(FORM)=".JPG" then comm=comm||' QUALITY 'QUALITY||' '
  539. comm=comm||' BOXFIT '||sizex||' '||sizey
  540. ADDRESS COMMAND comm
  541. end
  542. if ~exists(directory''dest||names.f) then call AddList("\033bError: GfxCon could not create the thumbnail!")
  543. gauge ID STAPR ATTRS MUIA_Gauge_Current f
  544. check ID STABO
  545. if result=1 then abort=result
  546. if abort=1 then call abort
  547. END
  548. if res="" then res=800
  549. if perpage=0 then perpage=files
  550. number=1
  551. pagefiles=perpage
  552. pages=files%perpage
  553. if files//perpage ~=0 then pages=pages+1
  554. line="0a"x||"Creating "pages" index page"
  555. if pages>1 then line=line||"(s)"
  556. if picpage=1 then line=line||" and "files" picture pages"
  557. call AddList(line)
  558. gauge ID STAIN ATTRS MUIA_Gauge_Max pages MUIA_Gauge_InfoText '"Index HTML files (%ld/'pages')"'
  559. do p=1 to pages
  560. nownum=0
  561. if files-(perpage*p)<0 then pagefiles=files//perpage
  562. if pagefiles>0 then do
  563. max=res%((border*2)+sizex+7) 
  564. if (pagefiles//max) ~=0 then do 
  565. mostremainders=pagefiles//max
  566. do temp=max to 2 by -1 
  567. if pagefiles//temp > mostremainders then do 
  568. mostremainders=pagefiles//temp
  569. max=temp
  570. end
  571. end
  572. end
  573. rows=pagefiles%max
  574. if pagefiles//max ~=0 then rows=rows+1
  575. if open("out",directory||indexnames||p||".html","W") then do
  576. call AddList("Creating index page #"||p||"...")
  577. call WRITELN("out",'<HTML>'||R||'<BODY 'BACKGROUND||TEXTCOLOURS'>'||R||HEADER||'<CENTER>'||R||'<BR>')
  578. line=""
  579. line=line||'<FONT SIZE="'INDEXLINKSSIZE'">'
  580. do f=1 to pages
  581. if f=p then line=line||'[ <A HREF="'||indexnames||f||'.html"><B>'||f||'</B></A> ] '
  582. else line=line||'[ <A HREF="'||indexnames||f||'.html">'||f||'</A> ] '
  583. end
  584. line=line||'</FONT>'
  585. if INDEXLINKS="Both"|INDEXLINKS="Only Top" then do
  586. if pages>1 then call WRITELN("out",line||R||"<BR>")
  587. end
  588. call WRITELN("out",'<TABLE BORDER="'||border||'">')
  589. call pragma("STACK",22000)
  590. if pages=1 then gauge ID STAPI ATTRS MUIA_Gauge_Max files MUIA_Gauge_InfoText '"Picture HTML files (%ld/'files')"'
  591. else do
  592. if pages-p>0 then gauge ID STAPI ATTRS MUIA_Gauge_Max perpage MUIA_Gauge_InfoText '"Picture HTML files (%ld/'perpage')"'
  593. else do
  594. gaugenum=(files-((p-1)*perpage))
  595. gauge ID STAPI ATTRS MUIA_Gauge_Max gaugenum MUIA_Gauge_InfoText '"Picture HTML files (%ld/'gaugenum')"'
  596. end
  597. end
  598. do rows
  599. call WRITELN("out",' <TR ALIGN="CENTER">')
  600. do max
  601. if number-(perpage*(p-1))>pagefiles then iterate
  602. comm=GFXCON||' >T:thumbinfo "'||directory||dest||names.number||'" info'
  603. address command comm
  604. call OPEN("fileinfo","T:thumbinfo","r")
  605. do 4
  606. info=READLN("fileinfo")
  607. end
  608. parse var info "input size: " thumbx "x" thumby .
  609. thumbx=strip(thumbx,,' ')
  610. call CLOSE("fileinfo")
  611. filenames=GetFilename(filenames.number)
  612. if picpage then call WRITELN("out",'  <TD><A HREF="'||filenames||'.html"><IMG SRC="'||dest||names.number||'" ALT="'||filenames||'" WIDTH="'||thumbx||'" HEIGHT="'||thumby||'" BORDER="0"></A>')
  613. else call WRITELN("out",'  <TD><A HREF="'||filenames||'"><IMG SRC="'||dest||names.number||'" ALT="'||filenames||'" WIDTH="'||thumbx||'" HEIGHT="'||thumby||'" BORDER="0"></A>')
  614. underpicture='<BR><FONT SIZE="'FONTSIZE'">'
  615. if LINEFEED=1 then underpicture=underpicture||"<BR>"
  616. if FNAMEUPIC=1 then do
  617. underpicture=underpicture||filenames||" "
  618. end
  619. if SIZEUPIC=1 then do
  620. picsize=SUBWORD(STATEF(filenames.number),2,1)
  621. if SIZEKB="Bytes" then picsize=picsize||" bytes"
  622. if SIZEKB="KiloBytes" then do
  623. picsize=picsize/1024
  624. parse var picsize picsize "." .
  625. picsize=picsize||" KB"
  626. end
  627. underpicture=underpicture||"("||picsize||")"
  628. end
  629. underpicture=underpicture||"</FONT></TD>"
  630. call WRITELN("out",underpicture)
  631. if picpage then do
  632. line1=''
  633. if open(picfile,filenames.number||".html","W") then do
  634. line1=line1||'<HTML>'||R||'<BODY 'BACKGROUND||TEXTCOLOURS'>'||R||GetPercent(PHEADER,"2",filenames.number)||'<CENTER>'||R||'<BR>'||R
  635. comm=GFXCON||' >T:thumbinfo "'||filenames.number||'" info'
  636. address command comm
  637. call open("fileinfo","T:thumbinfo","r")
  638. do 4
  639. info=READLN("fileinfo")
  640. end
  641. parse var info "input size: " thumbx "x" thumby .
  642. call close("fileinfo")
  643. line1=line1||'<IMG SRC="'||filenames||'" WIDTH="'||thumbx||'" HEIGHT="'||thumby||'"><BR><PRE>'||R
  644. prev=number-1; next=number+1
  645. filenamesprev=GetFilename(filenames.prev)
  646. filenamesnext=GetFilename(filenames.next)
  647. if number>1 then line1=line1||'<A HREF="'filenamesprev||'.html">Previous</A>   '
  648. if number<files then line1=line1||'<A HREF="'||filenamesnext||'.html">Next</A>'
  649. call WRITELN(picfile,line1||'<BR></PRE>'||R||line||R||'</CENTER>'||R||GetPercent(PFOOTER,"2",filenames.number)||R||'</BODY>'||R||'</HTML>')
  650. call close(picfile)
  651. end
  652. else call AddList("\033bError: Cannot create picture page file for "||filenames||"!")
  653. end
  654. nownum=nownum+1
  655. gauge ID STAPI ATTRS MUIA_Gauge_Current nownum
  656. number=number+1
  657. check ID STABO
  658. if result=1 then call abort
  659. end
  660. check ID STABO
  661. if result=1 then call abort
  662. call WRITELN("out"," </TR>")
  663. end
  664. call WRITELN("out","</TABLE>")
  665. if INDEXLINKS="Both"|INDEXLINKS="Only Bottom" then do
  666. if pages>1 then call WRITELN("out",line||R||"<BR>")
  667. end
  668. call WRITELN("out","</CENTER>"||R||FOOTER||R||"</BODY>"||R||"</HTML>")
  669. call CLOSE("out")
  670. end
  671. else call AddList("\033bError: Cannot create index file!!!")
  672. end
  673. check ID STABO
  674. if result=1 then call abort
  675. gauge ID STAIN ATTRS MUIA_Gauge_Current p
  676. if p~=pages then gauge ID STAPI ATTRS MUIA_Gauge_Current 0
  677. end
  678. call AddList("\0333Done.")
  679. tid=time('e')-timer_start
  680. min=0
  681. if tid>=60 then do
  682. do UNTIL tid<60
  683. tid=tid-60
  684. min=min+1
  685. end
  686. end
  687. text ID TIMER ATTRS MUIA_Text_Contents '"It took '||min||' mins '||tid||' secs."'
  688. group ID PRTAB ATTRS MUIA_ShowMe 0
  689. group ID STGRP ATTRS MUIA_ShowMe 1
  690. button ID START ATTRS MUIA_Disabled 0
  691. button ID QUIT ATTRS MUIA_Disabled 0
  692. ADDRESS COMMAND "beep"
  693. call DELETE("T:thumbinfo")
  694. call DELETE("T:imgsizekb")
  695. call DELETE("T:imageinfo")
  696. return
  697. abort:
  698. call AddList("\0333Aborted.")
  699. text ID TIMER ATTRS MUIA_ShowMe 0
  700. group ID PRTAB ATTRS MUIA_ShowMe 0
  701. group ID STGRP ATTRS MUIA_ShowMe 1
  702. button ID START ATTRS MUIA_Disabled 0
  703. button ID QUIT ATTRS MUIA_Disabled 0
  704. ADDRESS COMMAND "beep"
  705. call DELETE("T:thumbinfo")
  706. call DELETE("T:imgsizekb")
  707. call DELETE("T:imageinfo")
  708. exit
  709. SORT: procedure expose filenames. files
  710. call AddList("Sorting list of files...")
  711. do f=1 to files-1
  712. n=f+1
  713. if filenames.f > filenames.n then do
  714. store=filenames.n
  715. filenames.n=filenames.f
  716. do bubpos=f-1 to 1 by -1 while (store < filenames.bubpos)
  717. n=bubpos+1
  718. filenames.n=filenames.bubpos
  719. end bubpos
  720. bubpos=bubpos+1
  721. filenames.bubpos=store
  722. end
  723. end
  724. return
  725. AddList:
  726. list ID STALI INSERT POS MUIV_List_Insert_Bottom STRING arg(1)
  727. list ID STALI ATTRS MUIA_List_Entries
  728. list ID STALI ATTRS MUIA_List_Active result
  729. return
  730. GoToURL:
  731. ADDRESS ThumbNailMaker
  732. string ID HINNA
  733. indexnames=result
  734. popasl ID GDIR
  735. directory=result
  736. if RIGHT(directory,1)~=":"&RIGHT(directory,1)~="/" then directory=directory||"/"
  737. openurl('file:///'directory||indexnames'1.html')
  738. return
  739. GetPercent:
  740. string1=arg(1)
  741. string2=""
  742. len=LENGTH(string1)
  743. do x=1 to len
  744. tecken=SUBSTR(string1,x,1)
  745. if tecken="%" then do
  746. x=x+1
  747. tecken=SUBSTR(string1,x,1)
  748. dir=directory
  749. if RIGHT(dir,1)="/" then dir=DELSTR(dir,LENGTH(dir),1)
  750. do UNTIL POS('/',dir)=0
  751. pl=pos('/',dir)
  752. if pl~=0 then dir=DELSTR(dir,1,pl)
  753. end
  754. if arg(2)=1 then do
  755. SELECT
  756. WHEN tecken="d" then string2=string2||DATE()
  757. WHEN tecken="p" then string2=string2||directory
  758. WHEN tecken="r" then string2=string2||dir
  759. WHEN tecken="t" then string2=string2||TIME()
  760. OTHERWISE string2=string2"%"tecken
  761. end
  762. end
  763. if arg(2)=2 then do
  764. ADDRESS COMMAND "list "arg(3)" >T:imageinfo"
  765. call OPEN("imageinfo","T:imageinfo","r")
  766. stuff=READLN("imageinfo")
  767. filedate=READLN("imageinfo")
  768. comment=READLN("imageinfo")
  769. call CLOSE("imageinfo")
  770. SELECT
  771. WHEN tecken="c" then do
  772. if LEFT(comment,2)=": " then string2=string2||DELSTR(comment,1,2)
  773. end
  774. WHEN tecken="d" then string2=string2||SUBWORD(filedate,4,1)
  775. WHEN tecken="n" then string2=string2||GetFilename(arg(3))
  776. WHEN tecken="p" then string2=string2||directory
  777. WHEN tecken="r" then string2=string2||dir
  778. WHEN tecken="s" then string2=string2||SUBWORD(STATEF(arg(3)),2,1)
  779. WHEN tecken="t" then string2=string2||SUBWORD(nfo,5,1)
  780. OTHERWISE string2=string2"%"tecken
  781. end
  782. end
  783. end
  784. else string2=string2||tecken
  785. end
  786. return(string2)
  787. GetFilename:
  788. fn=arg(1)
  789. pl=pos(':',fn)
  790. if pl~=0 then fn=DELSTR(fn,1,pl)
  791. do UNTIL POS('/',fn)=0
  792. pl=pos('/',fn)
  793. if pl~=0 then fn=DELSTR(fn,1,pl)
  794. end
  795. return(fn)
  796. KeyCheck:
  797. if exists("ThumbNailMaker.key") then do
  798. call OPEN("key","ThumbNailMaker.key","R")
  799. keydata=READLN("key")
  800. keydata2=READLN("key")
  801. call CLOSE("key")
  802. checksum=substr(keydata,1,1)
  803. serial=substr(keydata,2,1)
  804. serialchk=substr(keydata,3,1)
  805. name=substr(keydata,4,length(keydata)-3)
  806. checksume=substr(keydata2,1,1)
  807. email=substr(keydata2,2,length(keydata2)-1)
  808. end
  809. else Return("No")
  810. namelen=Length(name)
  811. realsum=c2d(checksum)
  812. serial=c2d(serial)
  813. serialchk=c2d(serialchk)
  814. temp=""
  815. do I=1 to namelen
  816. temp=temp||d2c(c2d(Right(Left(name,I),1))-(I*2))
  817. end
  818. name=temp
  819. temp=""
  820. do I=1 to namelen
  821. temp=temp||d2c(c2d(Right(Left(name,namelen+1-I),1)))
  822. end
  823. name=temp
  824. temp=""
  825. checksum=0
  826. do I=1 to namelen
  827. checksum=checksum+c2d(Right(Left(name,I),1))
  828. end
  829. do until checksum<255
  830. checksum=checksum-255
  831. end
  832. serial=serial-checksum
  833. serialchk=serialchk-20
  834. emaillen=Length(email)
  835. realsume=c2d(checksume)
  836. temp=""
  837. do I=1 to emaillen
  838. temp=temp||d2c(c2d(Right(Left(email,I),1))-(I*2))
  839. end
  840. email=temp
  841. temp=""
  842. do I=1 To emaillen
  843. temp=temp||d2c(c2d(Right(Left(email,emaillen+1-I),1)))
  844. end
  845. email=temp
  846. temp=""
  847. checksume=0
  848. do I=1 To emaillen
  849. checksume=checksume+c2d(Right(Left(email,I),1))
  850. end
  851. do until checksume<255
  852. checksume=checksume-255
  853. end
  854. OK="No"
  855. If realsum=checksum&serial=serialchk&realsume=checksume then OK="Yes"
  856. return(OK)
  857.